package com.lambda.use;

import org.junit.Test;

import java.util.function.BiFunction;

/**
 * 功能描述
 *
 * @author: jichao.huang
 * @date: 2025年06月04日 13:44
 */
public class BiFunctionUseTest {
    @Test
    public void test() {
        BiFunction<String, String, String> biFunction = (str1, str2) -> str1 + " " + str2;
        System.out.println(biFunction.apply("Hello", "World"));
    }

    @Test
    public void test2() {
        BiFunction<String, String, String> biFunction = String::concat;
        System.out.println(biFunction.apply("Hello", "World"));
    }

    @Test
    public void testAndThen() {
        BiFunction<String, String, String> biFunction = String::concat;
        String test = biFunction.andThen(str -> str.toUpperCase()).apply("hello", "world");
        System.out.println(test);
    }
}
